import { messages } from "share/common";
import React, { Component } from "react";
import { Menu, Layout } from "antd";
import "styles/supplier-management/airline-config/airline-config.scss";

import UseModel from "../hotel-config/tabs/set-use-model"; // 平台模式
import OrderModel from "../hotel-config/tabs/set-order-model"; // 预订模式
import HotelSupplier from "../hotel-config/tabs/set-hotel-supplier"; // 酒店服务商
import TravelStandard from "../hotel-config/tabs/set-travel-standard"; // 差标管控
import FeePush from "../hotel-config/tabs/set-fee-push"; // 费用推送设置
import SetView from "../hotel-config/tabs/set-view"; // 设置界面
import SetNotice from "./tabs/set-notice"; // 消息通知
import SetResidence from "./tabs/set-residence"; // 常驻地

const { Content, Sider } = Layout;

class HotelConfig extends Component {
  constructor() {
    super();
    this.components = {
      model: UseModel,
      order: OrderModel,
      supplier: HotelSupplier,
      travel: TravelStandard,
      fee: FeePush,
      view: SetView,
      notice: SetNotice,
      residence: SetResidence,
    };
    this.state = {
      companyOID: "",
      current: "model",
    };
  }

  handClick = (e) => {
    this.setState({
      current: e.key,
    });
  };
  render = () => {
    const { current } = this.state;
    const TabComponent = this.components[current];
    return (
      <Layout className="airline-config">
        <Sider style={{ background: "#fff", position: "static" }}>
          <Menu
            onClick={this.handClick}
            selectedKeys={[this.state.current]}
            defaultSelectedKeys={["search"]}
            style={{ height: "100%" }}
          >
            <Menu.Item key="model">{messages("supplier-1.key483") /*平台模式*/}</Menu.Item>
            <Menu.Item key="order">{messages("supplier-1.key343") /*预订模式*/}</Menu.Item>
            <Menu.Item key="supplier">{messages("supplier-1.key484") /*酒店服务商*/}</Menu.Item>
            <Menu.Item key="travel">{messages("supplier-1.key345") /*差标管控*/}</Menu.Item>
            <Menu.Item key="view">{messages("supplier-1.key347") /*界面显示*/}</Menu.Item>
            <Menu.Item key="fee">{messages("supplier-1.key485") /*费用推送*/}</Menu.Item>
            <Menu.Item key="notice">{messages("supplier-1.key349") /*消息通知*/}</Menu.Item>
            <Menu.Item key="residence">{messages("supplier-1.key468") /*常驻地*/}</Menu.Item>
          </Menu>
        </Sider>
        <Content style={{ background: "#fff" }}>
          <TabComponent companyOID={this.props.params.companyOID} companyName={this.props.params.companyName} />
        </Content>
      </Layout>
    );
  };
}

export default HotelConfig;
